package org.data.replay.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @author RAN
 * @data 2025/4/10 15:35
 * @description: 故障数据model
 */
@Data
public class FaultResultModel {

    /**
     * id主键
     */
    private String id;

    /**
     * 故障名称
     */
    private String name;
    
    /**
     * 故障点位列表
     */
    private List<StartAndEndPoint> occurrences;

    /**
     * 故障点位
     */
    @Data
    public static class StartAndEndPoint {
        /**
         * 开始时间
         */
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date startTime;
        
        /**
         * 结束时间
         */
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date endTime;
        
        private String alarmLevel;
    }
}
